<%@ page import="java.net.URLDecoder" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>影院热映大片_热映电影票房_高清电影影视大全</title>
<meta name="keywords" content="影院热映大片,热映电影票房,热映电影购票,热映电影打分,热映电影选座">
<meta name="description" content="为您提供热映电影大片选座购票服务，以及对热映电影评分、评价等信息介绍">
<meta http-equiv="cleartype" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<meta name="HandheldFriendly" content="true">
<meta name="format-detection" content="email=no">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="lx:autopv" content="off">
<meta name="lx:appnm" content="movie">
<meta name="lx:category" content="movie">
<script type="text/javascript"
        src="${pageContext.request.contextPath }/js/jquery-easyui-1.3.0/jquery-1.7.2.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.cookie.js" type="text/javascript"></script>
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/frontcss/common.0a548310.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/frontcss/movie-list.22f5a22a.css">
<style>
    @font-face {
        font-family: stonefont;
        src: url('//vfile.meituan.net/colorstone/ccf4796ee951e95512a3d916a52331283436.eot');
        src: url('//vfile.meituan.net/colorstone/ccf4796ee951e95512a3d916a52331283436.eot?#iefix') format('embedded-opentype'),
        url('//vfile.meituan.net/colorstone/b96ae4658dfaaf4d5cb8c614653a49462276.woff') format('woff');
    }

    .stonefont {
        font-family: stonefont;
    }
</style>
<script type="text/javascript">

    function getCookie(name) {
        const cookieStr = document.cookie;
        if (cookieStr.length > 0) {
            const cookieArr = cookieStr.split(";"); //将cookie信息转换成数组
            for (let i = 0; i < cookieArr.length; i++) {
                const cookieVal = cookieArr[i].split("="); //将每一组cookie(cookie名和值)也转换成数组
                if (cookieVal[0].trim() == name) {
                    return decodeURI(cookieVal[1]); //返回需要提取的cookie值
                }
            }
        }
    }

    //页面载入时自动实现定位，并写入cookie中
    window.onload = function () {
        const cityString = returnCitySN.cname.toString();
        let start, end, cityName;
        end = cityString.lastIndexOf("市");
        if ((start = cityString.indexOf("省")) != -1 || (start = cityString.indexOf("区")) != -1) {
            cityName = cityString.substring(start + 1, end)
        }
        let cn = getCookie('cityName');
        if (cn != null || cn != undefined) {
            return;
        }
        $("#myCityId").text(cityName);
        $("#myCityId2").text(cityName);
        $.post('${pageContext.request.contextPath}/front/index/setCityCookie',
            {
                "cityName": cityName
            }
            , function (data) {
                if (data == false) {
                    alert("自动定位失败!");
                    $("#myCityId").text("未知");
                    $("#myCityId2").text("未知");
                }
            }, 'text');
    }

    function openCity() {
        $.post(
            '${pageContext.request.contextPath}/front/index/cityList',
            {},
            function (data) {
                var str = "";
                //循环省份
                $.each(data.provList, function (i, item) {
                    str += "<li>";
                    str += "<span>" + item.provinceName + "</span>";
                    str += "<div>";
                    $.each(item.cityList, function (j, it) { //循环城市
                        str += "<a class=\'js-city-name\' onclick=\'closeCity(" + it.cityId + ");\'>" + it.cityName + "</a>";
                    });
                    str += "</div>";
                    str += "</li>";
                });
                $("#cityData").html(str);
            },
            "json"
        );
        $("#cityList").show();
    }

    function closeCity(cityId) {
        $.post(
            '${pageContext.request.contextPath}/front/index/myCity',
            {
                "cityId": cityId
            },
            function (data) {
                $("#myCityId").text(data.city.cityName);
                $("#myCityId2").text(data.city.cityName);
                $("#cityList").hide();
                window.location.reload(true);
            },
            "json"
        );
    }

    function closeDiv() {
        $("#cityList").hide();
    }
</script>
<%
    String cityName = "未知";
    Cookie[] cookies = request.getCookies();
    if (cookies != null) {
        for (int i = 0; i < cookies.length; i++) {
            if (cookies[i].getName().equals("cityName")) {
                cityName = URLDecoder.decode(cookies[i].getValue(), "utf-8");
                break;
            }
        }
    }
%>
<div class="header">
    <div class="header-inner">
        <a href="${pageContext.request.contextPath}/" class="logo"></a>
        <div class="city-container">
            <div class="city-selected">
                <div class="city-name" onclick="openCity();">
                    <span id="myCityId"><%=cityName%></span>
                    <span class="caret"></span>
                </div>
            </div>
            <div class="city-list" id="cityList" onmouseleave="closeDiv();">
                <div class="city-list-header">定位城市：<a class="js-geo-city"
                                                      id="myCityId2"><%=cityName.equals("未知") ? "" : cityName%>
                </a></div>
                <ul id="cityData">
                </ul>
            </div>
        </div>
        <div class="nav">
            <ul class="navbar">
                <li><a href="${pageContext.request.contextPath}/front/index/index"
                       <c:if test="${param.menuId==1}">class="active"</c:if>>首页</a></li>
                <li>
                    <a href="${pageContext.request.contextPath}/front/index/movie?playType=2&movieTypeId=-1&movieYearId=-1&movieAreaId=-1"
                       <c:if test="${param.menuId==2}">class="active"</c:if>>电影</a></li>
                <li><a href="${pageContext.request.contextPath}/front/index/agent?hallTypeId=-1"
                       <c:if test="${param.menuId==3}">class="active"</c:if>>影院</a></li>
                <li><a href="${pageContext.request.contextPath}/front/index/movieTop"
                       <c:if test="${param.menuId==4}">class="active"</c:if>>榜单</a></li>
                <li><a href="${pageContext.request.contextPath}/front/index/actor"
                       <c:if test="${param.menuId==5}">class="active"</c:if>>演员</a></li>
            </ul>
        </div>
        <div class="user-info">
            <div class="user-avatar has-login">
                <img src="${pageContext.request.contextPath}/<c:if test="${member==null || member.headImg==''}">/card/headImg.png</c:if><c:if test="${member.headImg!=''}">${member.headImg}</c:if>">
                <span class="caret"></span>
                <ul class="user-menu">
                    <li class="text">
                        <a href="${pageContext.request.contextPath}/front/index/v/myOrder">我的订单</a>
                    </li>
                    <li class="text login-name" title="Kwq331523410"><a
                            href="${pageContext.request.contextPath}/front/index/v/myInfo">基本信息</a></li>
                    <c:if test="${member!=null}">
                        <li class="text"><a href="${pageContext.request.contextPath}/front/index/exit" class="J-logout"
                                            data-act="logout-click">退出登录</a></li>
                    </c:if>
                    <c:if test="${member==null}">
                        <li class="text"><a href="${pageContext.request.contextPath}/front/login.jsp" class="J-logout"
                                            data-act="logout-click">登录</a></li>
                    </c:if>
                </ul>
            </div>
        </div>
        <form action="${pageContext.request.contextPath}/front/index/searchMovie" target="_blank" class="search-form"
              data-actform="search-click">
            <input name="movieName" class="search" type="text" maxlength="32" placeholder="找影视剧" autocomplete="off">
            <input class="submit" type="submit" value="">
        </form>
    </div>
</div>
<div class="header-placeholder"></div>
